<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>箭头函数</title>
</head>
<body>
<p>通过箭头函数简化代码</p>
<p> 箭头函数提供了一种更加简洁的函数书写方式。基本语法是：参数 => 函数体</p>
<script>
    let list=[10,20,30];

    let newList =list.map(function (value,index) {
        return value*value;
    });
    console.log(newList);//Array(3) 0: 100   1: 400    2: 900   length: 3

    let newList1=list.map((value, index) => {
        return value *value;
    });
    console.log(newList1);//(3) [100, 400, 900]
</script>
</body>
</html>
